/*********************************************
*		
*		File Name : MainMenuBar.java
*		Author    : HuangYao
*		Email     : huangyaobyte@gmail.com
*		Date      : Feb 4, 2014
*		
*********************************************/
/*
*    
*/



package nsg2.swing;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import nsg2.Main;

/**
 * @author huangyao
 * 主界面定制menubar
 */
public class MainMenuBar extends JMenuBar {
	private JMenu menu;
	private JMenuItem jItem;
	private Main main;
	public MainMenuBar(final Main main){
		super();
		this.main = main;
		//File菜单制作
		menu = new JMenu("File");
		jItem = new JMenuItem("New Wired Project");
		jItem.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
//				System.out.println("Mark");
				WiredInterFrame frame = new WiredInterFrame("wired ----");
				main.add(frame);
				frame.setSize(main.getJdp().getWidth(),main.getJdp().getHeight());

			}
			
		});
		menu.add(jItem);
		jItem = new JMenuItem("New Wireless Project");
		menu.add(jItem);
		jItem = new JMenuItem("Import Exist Project");
		menu.add(jItem);
		jItem = new JMenuItem("Save");
		menu.add(jItem);
		jItem = new JMenuItem("Save As");
		menu.add(jItem);
		jItem = new JMenuItem("Exit");
		menu.add(jItem);
		this.add(menu);
		//Help菜单制作
		menu = new JMenu("Help");
		jItem = new JMenuItem("About");
		menu.add(jItem);
		jItem = new JMenuItem("Project Site");
		menu.add(jItem);
		this.add(menu);
	}
	
}
